package com.business.common.exception;

import com.business.common.enums.ErrorEnum;

/**
 * 自定义异常类
 * 
 * @author wtm
 *
 */
public class CustomException extends RuntimeException {
	
	private static final long serialVersionUID = 1L;
	
	private Integer code;

	public CustomException(ErrorEnum errorEnum) {
		super(errorEnum.getMsg());
		this.code = errorEnum.getCode();
	}

	public CustomException(ErrorEnum errorEnum,String detailed) {
		super(errorEnum.getMsg()+ "," + detailed);
		this.code = errorEnum.getCode();
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}
}
